{% include file="index.header.tpl.php" %}
{% include file="index.left.tpl.php" %}
<!--主要内容开始-->
<div class="content-wrapper">
<section class="content">
  <div class="row">
	<section class="col-lg-12 connectedSortable">
	 <div class="box box-default box-solid">
		 <form name="myform" action="" method="get">
			<div class="box-header with-border">
				<span class="fa fa-table" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
				<p class="box-title">学月汇总表</p>
			
			</div>
			   <div class="box-body">
				<div class="col-sm-3 form-group">
					  <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding:0;">
						   学年学期：
					  </label>
					  <div class="input-group col-sm-8 col-xs-12">
						   <select class="form-control" id="semester_id" name="semester_id">
								  <option value="">请选择</option>
								{%foreach from=$semester_lists key=key item=value%}
								  <option value="{%$key%}" {%if $key==$semester_id%}selected{%/if%}>
								  {%$value%}</option>
								{%/foreach%}
							</select>
					  </div> 
				 </div>
				 <div class="col-sm-3 form-group">
					  <label for="inputPassword3" class="col-sm-3 control-label" style="padding:0;">
						   学月：
					  </label>
					  <div class="input-group col-sm-5 col-xs-12" style="float:left; margin-right:6px;">
						   <select class="form-control" name="semester_month" id="semester_month">
								  <option value="">请选择</option>
								  {%foreach from=$month_lists key=key item=value%}
								  <option value="{%$key%}" {%if $key==$semester_month%}selected{%/if%}>
								  {%$key%}</option>
								  {%/foreach%}
							</select>
					  </div> 
					  <input type="hidden" name="a" value="sanitation.monthlist">
					  <button class="btn btn-primary">确 定</button>
				 </div>  
				 <div style="clear:both; height:10px;"></div>
			   <h4 class="text-center">{%$semester_data.semester_xname%}{%$semester_data.semester_name%}各班每月汇总表</h4>
				 <!-- <table class="table table-bordered"  id="mytable">
								<tr>
									<td rowspan="2">班级</td>
									<td colspan="2" align="center">第一周</td>
									<td colspan="2" align="center">第二周</td>
									<td colspan="2" align="center">第三周</td>
									<td colspan="2" align="center">第四周</td>
									<td colspan="2" align="center">合计</td>
								</tr>
								
								<tr>
								
									<td>常规</td>
									<td>其他</td>
									<td>常规</td>
									<td>其他</td>
									<td>常规</td>
									<td>其他</td>
									<td>常规</td>
									<td>其他</td>
									<td>常规</td>
									<td>其他</td>
								</tr>
								{%foreach from=$list key=key item=value%}
								 <tr>
								 <td>{%$key%}</td>
									{%foreach from=$value.list key=k item=v%}
									<td>{%$v.sanitation_rule%}</td>
									<td>{%$v.sanitation_rests%}</td>
									
									
									{%/foreach%}
									 <td>{%$value.all.sanitation_rule%}</td>
									<td>{%$value.all.sanitation_rests%}</td>
								</tr>
							   {%/foreach%}	
					</table>-->
				   <table class="table table-bordered"  id="mytable">
					   <tr>
						   <td rowspan="2">班级</td>
						   {%foreach from=$weeks item=value%}
						   <td colspan="2" align="center">第{%$value%}周</td>
							{%/foreach%}
						   <td colspan="2" align="center">合计</td>
					   </tr>

					   <tr>
						   {%foreach from=$weeks item=value%}
						   <td>常规</td>
						   <td>其他</td>
						   {%/foreach%}
						   <td>常规</td>
						   <td>其他</td>

					   </tr>
					   {%foreach from=$class_lists key=key item=value%}
					   <tr>
						   <td>{%$value.class_name%}</td>
						   {%foreach from=$value.infos key=ke item=va%}
						   <td>{%$va.sanitation_rule%}</td>
						   <td>{%$va.sanitation_rests%}</td>
						   {%/foreach%}
						   <!--<td>{%$value.content.sanitation_rule%}</td>
                          <td>{%$value.content.sanitation_rests%}</td>-->
					   </tr>
					   {%/foreach%}
				   </table>
			   </div><!--box-body -->
			   <div class="box-footer text-center">
			   {%$page%}
			   </div>
		   </form>
	   </div><!--box box-default box-solid-->
	</section>   
	</div><!--row-->
</section>
</div>
  <!--主要内容结束-->
  {% include file="index.footer.tpl.php" %}
 <!--      二级联动     -->
<script type="text/javascript">
        $(document).ready(function () {
            $("#semester_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=semester.monthjson",
			type:"get",
			data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
			   
					//实例2个字符串变量来拼接下拉列表
					var industr = "";
					//使用jquery解析json中的数据
					$.each(msg, function (n, value) {
						industr += ("<option value=\"" + value.semester_month + "\">" + value.semester_month);
						industr += ("</option>");
					});

					$("#semester_month").html(industr);			   			   
			}
			});					

                }

            });

        });
</script>